package com.aaa.moneymanage.controller.api;

import com.aaa.entity.OrderBackfee;
import com.aaa.entity.OrderBackfeeItem;
import com.aaa.moneymanage.services.MoneyoutServices;
import com.aaa.moneymanage.vo.MoneyVo;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ：XiaoxXuan
 * @date ：Created in 2023/3/23 19:20
 * @description：退费查询
 * @modified By：
 */
@RestController
@RequestMapping("/charge/api/moneyout")
public class ApiMoneyoutController {

    @Resource
    private MoneyoutServices moneyoutServices;

    /**
     *  * @create by: XiaoXuan
     *
     * @param pageSize
     * @param moneyVo 
     * @return com.aaa.vo.Result<com.baomidou.mybatisplus.core.metadata.IPage < com.aaa.moneymanage.entity.OrderBackfee>> 
     * @description: 查询数据以及分页调用方法  
     * @create time: 2023/3/27 9:34
     * * @param currentPage
     */
    @PostMapping("selectAll/{currentPage}/{pageSize}")
    public Result<IPage<OrderBackfee>> list(
            @PathVariable Integer currentPage,
            @PathVariable Integer pageSize,
            @RequestBody MoneyVo moneyVo
    ) {
        return moneyoutServices.getMoneyIn(currentPage, pageSize, moneyVo);
    }

    /**
     *  * @create by: XiaoXuan
     *
     * @return com.aaa.vo.Result<java.util.List < com.aaa.moneymanage.entity.OrderChargeItem>> 
     * @description: 前端查看详情调用方法，查询数据通过orderid 
     * @create time: 2023/3/27 9:32
     * * @param orderId 
     */
    @GetMapping("selectOneByOrderId")
    public Result<List<OrderBackfeeItem>> selectOneByOrderId(String backId) {
        return moneyoutServices.selectOneByOrderId(backId);
    }

}